﻿<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

//load css
JHTML::stylesheet( 'monoslideshow.css', 'administrator/components/com_jmonoslideshow/assets/css/' );
JHTML::stylesheet( 'jquery-ui.custom.css', 'administrator/components/com_jmonoslideshow/assets/css/Aristo/' );

JHTML::script( 'jquery.min.js', 'administrator/components/com_jmonoslideshow/assets/js/' );
JHTML::script( 'jquery-ui.custom.min.js', 'administrator/components/com_jmonoslideshow/assets/js/' );



$db =& JFactory::getDBO();
$nullDate 		= $db->getNullDate();
$params = &JComponentHelper::getParams( 'com_jmonoslideshow' );
jimport('joomla.environment.uri' );

if(isset($_FILES['model']))
{
	//load slideshow model
	require_once( JPATH_ADMINISTRATOR .DS.'components'.DS.'com_jmonoslideshow'.DS.'models'.DS.'model.php' );
	$model = new JmonoslideshowModelModel();
	$model->import();
}

?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'model.cancel')) {
			
			Joomla.submitform(task, document.getElementById('modelForm'));
		}
		else {
			alert(Joomla.JText._('JGLOBAL_VALIDATION_FORM_FAILED','Some values are unacceptable'));
		}
	}
</script>

<form action="<?php echo JRoute::_('index.php?option=com_jmonoslideshow&view=import'); ?>" method="post" name="adminForm" id="modelForm" enctype="multipart/form-data">
  <div class="col100">
   
 <input type="file" name="model"></input>
 <input type="submit" value="Importer" />
 <input type="hidden" name="task" value="" />
 <?php echo JHtml::_('form.token'); ?>
</div>
</form>
